import axios, { AxiosInstance } from "axios";

const instance: AxiosInstance = axios.create({
  baseURL: "http://td.dev.txstandard.sf/v1/",
  timeout: 10000,
  headers: {
    "authorization":
      "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImZqSFhfdEo2SU9tc08tbWx5Mi1nZ0lDekt5QXlSOWM0IiwiaWF0IjoxNzQzNjYwOTAzfQ.s3SzU8MB0OOZc_syFUbBW29MIFKsYIq47H9ES7HbxSU",
    "td-op-uid": 3812,
  },
});

const request = async (url: string, data: any) => {
  const res = await instance.post(url, {
    data,
  });
  return res.data.data;
};

export default request;
